package com.immunology.database.transformers;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.apache.log4j.Logger;

import com.immunology.core.BaseTransformer;
import com.immunology.database.DbColumns;
import com.immunology.model.Syndrome;

public class SyndromeTransformer extends BaseTransformer<Syndrome> {
	private static final Logger LOG = Logger
			.getLogger(SyndromeTransformer.class);

	@Override
	public Syndrome transformTo(ResultSet resultSet) {
		Syndrome syndrome = new Syndrome();
		try {
			syndrome.setId(resultSet.getInt(DbColumns.FIRST_COLUMN));
			syndrome.setName(resultSet.getString(DbColumns.SECOND_COLUMN));
		} catch (SQLException e) {
			LOG.error("Can't create SyndromeTransformer object:", e);
		}
		return syndrome;
	}

}
